package com.hyl.entity;

import com.hyl.annotation.*;

/**
 * Student
 *
 * @author hyl
 * @date 2025-06-11
 */
@ClassValid(name = "aaa")
public class Student {

    private int id;
    @StringValid(message = "姓名格式不正确", min = 2)
    private String name;
    @NumberValid( min = 0, max = 120, message = "年龄范围不正确")
    private int age;

    @StringValid(message = "长度不正确", min = 2)
    @DateValid(message = "出生日期格式不正确", format = "yyyy-MM-dd")
    private String born;



    @Log
    public void show(){
        System.out.println("id:"+id+"name:"+name+"age:"+age+"born:"+born);
    }
    public void print(){
        System.out.println("id:"+id+"name:"+name+"age:"+age+"born:"+born);
    }


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getBorn() {
        return born;
    }

    public void setBorn(String born) {
        this.born = born;
    }
}
